package com.yh.spring.struts.controller;

import javax.servlet.http.HttpServletRequest;

import org.apache.catalina.connector.Request;
import org.apache.struts2.ServletActionContext;
import org.springframework.beans.factory.annotation.Autowired;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
import com.yh.spring.mybatis.model.Users;
import com.yh.spring.mybatis.service.IUserService;

public class UserAction extends ActionSupport implements ModelDriven<Object>{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Autowired
	private IUserService userService;
	
	private Users users ;
	

	
    
	public String getUser() {
		users=userService.getUsers(users);
		if(users!=null){
		return "success";
		}else
		return "error";
		
	}

	@Override
	public Object getModel() {
		if(users==null){
			users=new Users();
		}
		return users;
	}
	

}
